import 'package:json_annotation/json_annotation.dart';
// part 'user_entity.g.dart';

@JsonSerializable()
class CUserProfile {
  CUserProfile({
    required this.id,
    required this.name,
    required this.avatar,
    required this.alreadyFriend,
    this.option2,
  });

  @JsonKey(required: true)
  String id;

  @JsonKey(required: true)
  String name;

  @JsonKey(required: true)
  String avatar;

  @JsonKey(required: true)
  bool alreadyFriend;
  
  /// 个性签名
  @JsonKey()
  String? option2;

  CUserProfile copyWith({
    String? id,
    String? name,
    String? avatar,
    bool? alreadyFriend,
    String? option2,
  }) =>
      CUserProfile(
        id: id ?? this.id,
        name: name ?? this.name,
        avatar: avatar ?? this.avatar,
        alreadyFriend: alreadyFriend ?? this.alreadyFriend,
        option2: option2,
      );

  // factory CUserProfile.fromJson(Map<String, dynamic> json) =>
  //     _$CUserProfileFromJson(json);

  // Map<String, dynamic> toJson() => _$CUserProfileToJson(this);
}
